package TimerLogs;

import Logs.Logger;

public class TimerLog implements Logger
{
	long _lastTime;
	boolean _enabled;
	
	public TimerLog()
	{
		_enabled = false;
	}
	
	public void Start()
	{
		_enabled = true;
		_lastTime = System.nanoTime();
	}
	
	public void Stop()
	{
		_enabled = false;
	}
	
	public void Log(String what)
	{
		if (_enabled)
			System.out.format("[took %d ms]: %s\n", new Long(System.nanoTime() - _lastTime) / 1000000, what);
		
		_lastTime = System.nanoTime();
	}
}
